package com.example.design.shejimoshi.action.huitiao;

import java.util.concurrent.atomic.AtomicReference;

/**
 * 业务类
 */
public class CallBackTest {
    public static void main(String[] args) {
        // 获取异步调用结果
        AtomicReference<String> resStr = new AtomicReference<>("");
        RemoteApiAdapter remoteApiAdapter = new HttpClientRemoteApiAdapter();
        remoteApiAdapter.execute("a", res -> resStr.set(res));

        System.out.println(resStr.get());
    }
}
